1. Field of the Invention
The present invention relates to a video stream encoder and video stream encoding method, and a video stream multiplexer and video stream multiplexing method, and more particularly, to a video stream encoder and video stream encoding method, and a video stream multiplexer and video stream multiplexing method, capable of re-encoding, for edition of a video stream, the video stream without reference to information indicative of an initial status of a video buffer when re-encoding a part of the video stream.
2. Description of the Related Art
There is available the MPEG (Moving Picture coding Experts Group) standard as one of the techniques for encoding video streams representing a moving picture. The MPEG standard prescribes a virtual decoder model for connection to the output of an encoder. More specifically, to prevent any underflowing and overflowing of a buffer in the decoder model, to which an encoded video stream is supplied, the MPEG standard limits the buffer capacity anticipated when encoding the video stream. By thus limiting the occupancy by stored data of the buffer included in the decoder model, the MPEG defines a limitation imposed on the encoding of a video stream. The virtual decoder model is called “VBV (Video Buffering Verifier)” and the buffer in the virtual decoder is called “VBV buffer”.
For conformity with the requirements prescribed in the MPEG standard, a video stream should be encoded for neither underflowing nor overflowing of the VBV buffer. For example MP@ML (Main Profile at Main Level) of the MPEG-2 standard, the VBV buffer size is defined as 1.75 Mbits.
The encoder encodes a 16-bit field included in each picture and called “information indicative of an initial status of a video buffer” indicative of an initial status of the buffer at a random access. The information indicative of an initial status of a video buffer has a value representing a bit storage quantity (bit occupancy) the VBV buffer should have for decoding the picture. When decoding a picture, the virtual decoder reads a information indicative of an initial status of a video buffer appended to the picture, and then decodes the picture when the VBV buffer has a bit storage quantity represented by the information indicative of an initial status of a video buffer.
When editing two video streams encoded according to the MPEG standard to concatenate them with an accuracy of pictures, a few pictures before and after an edit point which is a concatenation between the two video streams are re-encoded in some cases. For a picture reproduction with a decoding of the edited video streams with no seam between them by the decoder, it is necessary that the video streams should have been edited and re-encoded for no overflowing and underflowing of the VBV buffer. To this end, an outpoint-side picture, in the edited video stream, positioned temporally before the edit point and an inpoint-side picture positioned temporally after the edit point are re-encoded as will be described below:
To re-encode an outpoint-side picture, the encoder first reads the information indicative of an initial status of a video buffer of a picture before a first picture to be re-encode. Next, the encoder uses the read information indicative of an initial status of a video buffer to calculate an initial bit storage quantity the VBV buffer should have for re-encoding the first picture to re-encoded by the VBV. Then, based on the computed initial bit storage quantity, the encoder re-encodes the pictures according to the VBV model.
Also, to re-encode an inpoint-side picture, the encoder first reads the information indicative of an initial status of a video buffer of a picture next to a last picture to re-encode. Next, the encoder uses the read information indicative of an initial status of a video buffer to calculate a bit storage quantity the VBV buffer should have for the last picture to re-encode by the VBV. Then, the encoder re-encodes the picture from the computed bit storage quantity according to the VBV model.
The MPEG-2 standard prescribes that it may optionally be selected whether or not information indicative of an initial status of a video buffer value should be encoded to be header information of a picture layer and included in a video stream. Therefore, in many cases, the above encoder encodes, into a value “0xFFFF”, the 16-bit information indicative of an initial status of a video buffer field included in header information of a picture layer of a video stream having been encoded in conformity to the MPEG-2 standard. Thus, when the information indicative of an initial status of a video buffer value is optionally encoded, it is not possible to calculate a correct bit storage quantity of the VBV buffer for an arbitrary picture. Therefore, with the above encoder, a bit storage quantity cannot be computed and a picture cannot be re-encoded from any bit storage quantity when editing video streams.